package com.xiaoxiao.android;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;


public class DetailLiveKeeper extends Activity {
	
	private ListView listView;
	
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.detail_listview);
		
		String[] from=new String[] {"txt_index","txt_type", "txt_fee","txt_date"}; 
	    int[] to=new int[] { R.id.txt_index, R.id.txt_type,R.id.txt_fee,R.id.txt_date};
		SimpleAdapter simpleAdapter = new SimpleAdapter(this, getData(), R.layout.item_detail, from, to);
		listView = (ListView) findViewById(R.id.lst_detail);
		listView.setAdapter(simpleAdapter);
	}
	
	
	private List<Map<String, Object>> getData(){
		
	     List<Map<String, Object>> fillMaps = new ArrayList<Map<String, Object>>();
	     for(int i=1;i<11;i++){
	        HashMap<String, Object> map = new HashMap<String, Object>();
	        map.put("txt_index", "" + i);
	        map.put("txt_type", "吃");
	        map.put("txt_fee", i);
	        map.put("txt_date", "2011-3-11" );        	
	        fillMaps.add(map);
	      }
	     return fillMaps;
	}

}
